#include <bits/stdc++.h>

using namespace std;

int r[100010];

int main()
{
	freopen("duel.in" , "r" , stdin);
	freopen("duel.out" , "w" , stdout);
	int n , cnt = 0;
	cin >> n;
	for (int i = 1 ; i <= n ; i++)
	{
		cin >> r[i];
		if (r[i] == 2)
			cnt++;
	}
	int ans = n - cnt * 2;
	ans += cnt;
	cout << cnt;
	return 0;
}
